package com.kzw.oa.model.system;

import java.io.Serializable;

import org.apache.commons.lang.builder.EqualsBuilder;
import org.apache.commons.lang.builder.HashCodeBuilder;
import org.apache.commons.lang.builder.ToStringBuilder;

public class AppFunction implements Serializable {

	protected Long functionId;
	protected String funKey;
	protected String funName;

	protected java.util.Set<FunUrl> funUrls = new java.util.HashSet<FunUrl>();

	// protected java.util.Set roleFuns = new java.util.HashSet();

	public AppFunction() {
		super();
	}

	public AppFunction(String funKey, String funName) {
		super();
		this.funKey = funKey;
		this.funName = funName;
	}

	/**
	 * Default Key Fields Constructor for class AppFunction
	 */
	public AppFunction(Long in_functionId) {
		this.setFunctionId(in_functionId);
	}

	public java.util.Set<FunUrl> getFunUrls() {
		return funUrls;
	}

	public void setFunUrls(java.util.Set in_funUrls) {
		this.funUrls = in_funUrls;
	}

	public Long getFunctionId() {
		return this.functionId;
	}

	/**
	 * Set the functionId
	 */
	public void setFunctionId(Long aValue) {
		this.functionId = aValue;
	}

	/**
	 * 权限Key *
	 */
	public String getFunKey() {
		return this.funKey;
	}

	public void setFunKey(String aValue) {
		this.funKey = aValue;
	}

	/**
	 * 权限名称 *
	 */
	public String getFunName() {
		return this.funName;
	}

	public void setFunName(String aValue) {
		this.funName = aValue;
	}

	public boolean equals(Object object) {
		if (!(object instanceof AppFunction)) {
			return false;
		}
		AppFunction rhs = (AppFunction) object;
		return new EqualsBuilder().append(this.functionId, rhs.functionId)
				.append(this.funKey, rhs.funKey).append(this.funName,
						rhs.funName).isEquals();
	}

	public int hashCode() {
		return new HashCodeBuilder(-82280557, -700257973).append(
				this.functionId).append(this.funKey).append(this.funName)
				.toHashCode();
	}

	public String toString() {
		return new ToStringBuilder(this).append("functionId", this.functionId)
				.append("funKey", this.funKey).append("funName", this.funName)
				.toString();
	}

}
